﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BrokerBase.Lib.Policy;

namespace broker.duty.TPYRS
{
    class Class7
    {
        public void Calc200(IPolicyPeriodActing ppa, IDutyActing da)
        {

            da.Value = ppa.Amount * 0.09;

        }

        public void Calc200(IPolicyPeriodActing ppa, IDutyActing da)
        {

            if (ppa.SchemePeriodActing.InsurantStates.Contains("身故"))
            {
                da.Value = ppa.TotalFee;
                ppa.IsCurrentFinish = true;
            }

        }

        public void Calc200(IPolicyPeriodActing ppa, IDutyActing da)
        {

            if (ppa.SchemePeriodActing.InsurantStates.Contains("重疾"))
            {
                da.Value = ppa.Amount;
                ppa.IsCurrentFinish = true;
            }

        }

        public void Calc200(IPolicyPeriodActing ppa, IDutyActing da)
        {

            bool state=false;

            for (int i = 0; i <= ppa.Period; i++)
            {
                IPolicyPeriodActing ppa2 = ppa.PolicyActing.PeriodActings[i];

                if (ppa2.SchemePeriodActing.InsurantStates.Contains("重疾"))
                {
                    state = true;
                    break;
                }
            }

            if (state)
            {
                da.Value = ppa.Amount * 0.09;
            }
        }
    }
}
